'use strict'

module.exports = {
  up: (queryInterface, Sequelize) => {
    /*
      Add altering commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.bulkInsert('People', [{
        name: 'John Doe',
        isBetaMember: false
      }], {});
    */
    return queryInterface.bulkInsert(
      'Users',
      [
        {
          username: 'admin',
          password: '123',
          email: 'admin@gmail.com',
          is_admin: 1,
          status: 1,
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          username: 'guest',
          password: '1234',
          email: 'guest@gmail.com',
          is_admin: 0,
          status: 1,
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          username: 'test',
          password: 'test',
          email: 'test@gmail.com',
          is_admin: 0,
          status: 1,
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          username: 'random',
          password: 'random',
          email: 'random@gmail.com',
          is_admin: 0,
          status: 1,
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          username: 'aaa',
          password: 'aaa',
          email: 'aaa@gmail.com',
          is_admin: 0,
          status: 1,
          createdAt: new Date(),
          updatedAt: new Date(),
        },
        {
          username: 'bbb',
          password: 'bbb',
          email: 'bbb@gmail.com',
          is_admin: 0,
          status: 1,
          createdAt: new Date(),
          updatedAt: new Date(),
        },
      ],
      {}
    )
  },

  down: (queryInterface, Sequelize) => {
    /*
      Add reverting commands here.
      Return a promise to correctly handle asynchronicity.

      Example:
      return queryInterface.bulkDelete('People', null, {});
    */
    return queryInterface.bulkDelete('Users', null, {})
  },
}
